<template>
  <BasicDrawer
    v-bind="$attrs"
    @register="registerDrawer"
    :showFooter="false"
    :title="getTitle"
    :isDetail="false"
    :width="getIsMobile ? '95%':'80%'"
    @ok="handleSubmit"
  >
    <div class=" desc-wrap">
      <div v-for="i in 10" :key="i">这是通知公告{{ state.data }}操作日志Tab</div>
    </div>
  </BasicDrawer>
</template>

<script lang="ts" setup>
  import { reactive, computed } from 'vue';
  import { useAppInject } from '@/hooks/web/useAppInject';
  import { BasicDrawer, useDrawerInner } from '@/components/Drawer';

  defineOptions({ name: 'ArticleDetail' });
  const emit = defineEmits(['success', 'register']);
  const { getIsMobile } = useAppInject();
  const state = reactive({
    data: {}
  });
  const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
    setDrawerProps({ confirmLoading: false });
    state.data = data;
  });
  const getTitle = computed(() => '通知详情');

  async function handleSubmit() {
    try {

      setDrawerProps({ confirmLoading: true });
      closeDrawer();
      // emit('success');
    } finally {
      setDrawerProps({ confirmLoading: false });
    }
  }
</script>

<style></style>
